#!/bin/sh
single_sock="0 1->2<-2 3->4<-4 5->6<-12 13->8<-14 15->10<-16 17"
dual_sock="0 6->2<-1 7->4<-2 8->6<-3 9->8<-4 10->10<-5 11"
num="->[0-9]\+<-"
sub=" "

for i in `seq 2 2 12`; do
    tag="->$i<-"
    sel_s=`echo -n $single_sock | sed "s/$tag.*//g;s/$num/$sub/g"`
    sel_d=`echo -n $dual_sock | sed "s/$tag.*//g;s/$num/$sub/g"`
    echo "$sel_s vs $sel_d"
    echo -n "$i single:  "
    GOMP_CPU_AFFINITY="$sel_s"  ./svd $i USEEIO.mtx | awk '/time/ { print $4 }'
    echo -n "$i dual:  "
    GOMP_CPU_AFFINITY="$sel_d"  ./svd $i USEEIO.mtx | awk '/time/ { print $4 }'
done